package com.yueya.api.news;

import java.util.Map;

import com.jfinal.aop.Clear;
import com.jfinal.aop.Duang;
import com.jfinal.kit.JsonKit;
import net.sf.json.JSONObject;

import com.yueya.common.action.ApiController;

/**
 * 新闻
 * 
 * @author yangfeng
 * 
 */
public class INewsController extends ApiController {

	public void index() {
	}

	// 获取列表
	@Clear
	public void getPageList() {
		JSONObject jo = this.getJson();
		Map<String, Object> map = Duang.duang(INewsService.class).getPageList(jo);
		renderJson(JsonKit.toJson(map));
	}

	// 获取明细
	@Clear
	public void getDetail() {
		JSONObject jo = this.getJson();
		Map<String, Object> map = Duang.duang(INewsService.class).getDetail(jo);
		renderJson(JsonKit.toJson(map));
	}

	// 点赞
	public void setZan() {
		JSONObject jo = this.getJson();
		Map<String, Object> map = Duang.duang(INewsService.class).setZan(jo);
		renderJson(JsonKit.toJson(map));
	}

	// 取消点赞
	public void cancelZan() {
		JSONObject jo = this.getJson();
		Map<String, Object> map = Duang.duang(INewsService.class).cancelZan(jo);
		renderJson(JsonKit.toJson(map));
	}
	
	public void zan() {
		JSONObject jo = this.getJson();
		Map<String, Object> map = Duang.duang(INewsService.class).zan(jo);
		renderJson(JsonKit.toJson(map));
	}

	// 获取栏目列表
	public void getSubjectList() {
		JSONObject jo = this.getJson();
		Map<String, Object> map = Duang.duang(INewsService.class).getSubjectList(jo);
		renderJson(JsonKit.toJson(map));
	}
	
	//获取点赞列表数据
	public void getZanList() {
		JSONObject jo = this.getJson();
		Map<String, Object> map = Duang.duang(INewsService.class).getZanList(jo);
		renderJson(JsonKit.toJson(map));
	}
	

}
